package cn.dakaqi.services.impl;

import cn.dakaqi.dao.LogDao;
import cn.dakaqi.entities.SystemLog;
import cn.dakaqi.services.LogService;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author beliveli on 2016/5/29/0029
 */
@Component(value = "logService")
@Transactional
public class LogServiceImpl implements LogService
{
    @Resource
    private LogDao logDao;

    @Override
    public SystemLog save(SystemLog log) {
        return logDao.save(log);
    }

    @Override
    public SystemLog save(int type, String message)
    {
        SystemLog log = new SystemLog(type,message);
        return logDao.save(log);
    }
}
